package com.zookeeper.lock;

import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.ZooKeeper;

import java.io.IOException;
import java.util.Properties;

/**
 * Created by lee on 2016/11/28.
 */
class ZooKeeperUtils {

    static ZooKeeper getZooKeeper(String connectString, int sessionTimeout, Watcher watcher) {
        Exception e;
        try {
            return new ZooKeeper(connectString, sessionTimeout, watcher);
        } catch (IOException e1) {
            e1.printStackTrace();
            e = e1;
        }
        throw new RuntimeException(e);
    }
}
